package com.tsj.model.controller;

import com.tsj.model.config.LedgerAssetProperties;
import com.tsj.model.config.LedgerCostProperties;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author taoshujian
 * @version 1.0
 * @since 2025-11-12 10:35:59
 */
@RestController
@Tag(name = "配置文件查询")
@RequestMapping("/config")
public class ConfigFileController {
    @Autowired
    private LedgerCostProperties ledgerCostProperties;
    @Autowired
    private LedgerAssetProperties ledgerAssetProperties;

    @GetMapping("/fileId")
    @Hidden
    public String fileId(){
        // 获取配置值
        Long fileId = ledgerCostProperties.getTemplateFileId();
        return "fileId: " + fileId;
    }

    @GetMapping("/assetId")
    @Hidden
    public String assetId(){
        // 获取配置值
        Long fileId = ledgerAssetProperties.getTemplateFileId();
        if(fileId == null){
            return "没有配置";
        }
        return "fileId: " + fileId;
    }
}
